from fastapi import Query
from pydantic import BaseModel, Field

InInputChange = Query(
    ...,
    title="输入字符",
    description="文本框输入时发生的请求",
    example="hello",
    regex="[0-9a-zA-Z]{0,32}"
)


class OutInputChange(BaseModel):
    input: str = Field(..., title="输入", description="输入的字符串", example="hello")
    time: float = Field(..., description="返回服务器的时间", example=1635247642749)


class OutInputSubmit(BaseModel):
    status: bool = Field(True, description="返回字符串是否提交成功", example=True)
    time: float = Field(..., description="返回服务器的时间", example=1635247642749)


class OutInputClear(BaseModel):
    status: bool = Field(True, description="返回字符串是否清除成功", example=True)
    time: float = Field(..., description="返回服务器的时间", example=1635247642749)
